package fr.univ.surveyonline.language;

import java.util.ResourceBundle;

public class Language  {

	private static final String CHEMIN = "fr.univ.surveyonline.language.";
	
	private static ResourceBundle bundle_fr = ResourceBundle.getBundle(CHEMIN + "language_fr");
	private static ResourceBundle bundle_sp = ResourceBundle.getBundle(CHEMIN + "language_sp");
	private static ResourceBundle bundle_ge = ResourceBundle.getBundle(CHEMIN + "language_ge");
	private static ResourceBundle bundle_en = ResourceBundle.getBundle(CHEMIN + "language_en");

	public static Object getWord(String key,String langue) {
		if (langue.equals("GE")) {
			return bundle_ge.getObject(key);
		}
		if (langue.equals("EN")) {
			return bundle_en.getObject(key);
		}
		if (langue.equals("SP")) {
			return bundle_sp.getObject(key);
		}
		return bundle_fr.getObject(key);
	}
}
